{% extends "page/index.html" %}
{% load i18n %}

{% block css %}
    <link type="text/css" rel="stylesheet" media="all" href="/medias/css/groups.css" />
{% endblock %}

{% block content %}
    {{ block.super }}
    <div id="main">
      <form id="sort" method="post" action="">{% csrf_token %}
	<table>
	  <tr>
	    <td style="width: 29%">
	      <span class="Style2">{% trans "Par Nom :" %}</span>
	      <select name="name_starts_with">
	        <option value="">{% trans "Tous" %}</option>
		{% for letter in letters %}
		<option{% if args.name_starts_with %}{% ifequal args.name_starts_with letter %} selected="selected"{% endifequal %}{% endif %}>{{letter}}</option>
		{% endfor %}
	      </select>
	    </td>
	    <td style="width: 41%">
	      <span class="Style2">{% trans "Par genre :" %}</span>
	      <select name="genre">
	        <option value="">{% trans "Tous" %}</option>
		{% for genre in genres %}
	        <option value="{{ genre.pk }}"{% if args.genre %}{% ifequal args.genre genre.pk %} selected="selected"{% endifequal %}{% endif %}>{{ genre.name }}</option>
		{% endfor %}
	      </select>
	    </td>
	    <td style="width: 30%">
	      <span class="Style2">{% trans "Par pays :" %}</span>
	      <select name="country" name="select3">
	        <option value="">{% trans "Tous" %}</option>
		{% for country in countries %}
	        <option value="{{ country.code }}"{% if args.country %}{% ifequal args.country country.code %} selected="selected"{% endifequal %}{% endif %}>{{ country.name }}</option>
		{% endfor %}
	      </select>
	    </td>
	  </tr>
	  <tr>
	    <td colspan="3"><input type="submit" value="{% trans "Rechercher" %}"/></td>
	</table>
      </form>

      <table id="groups">
	<tr>
	  <th>{% trans "Nom du groupe" %}</th>
	  <th>{% trans "Genre de musique" %}</th>
	  <th>{% trans "Pays" %}</th>
	</tr>
	{% for group in groups %}
	<tr id="{{ group.code}}" class="{% cycle 'white' 'grey' %}">
	  <td><a href="{{ group.get_absolute_url }}">{{ group.name }}</td>
	  <td class="genre {{ group.class_css|upper }}"><a href="?genre={{ group.genre.pk }}">{{ group.genre }}</a></td>
	  <td class="pays">{% for country in group.countries.all %}{% if not forloop.first %} / {% endif %}<a href="?country={{ country.code }}">{{ country.name }}</a>{% endfor %}</td>
	</tr>
	{% empty %}
	<tr>
	  <td colspan="3"><em>{% trans "Aucun groupe dans cette rubrique pour le moment" %}</em></td>
	</tr>
	{% endfor %}
      </table>
      {% endblock %}


{% block admin %}
    <a href="/admin/groups/group/">Administration</a>
{% endblock %}

</form>
<p>&nbsp;</p>

</div>

